#!/bin/bash
# Author: brucecui
# Date: 2024-02-09
# This is a script which config the arch env for dev a os use in c.
# Note: 
#    This script only must be exec one time(because of the line16-17 will be repeat echo info)
#    Precondition: Archlinux must be installed in the form of an archinstall script with a Type of Desktop
# These will be installed:
#   - net-tools
#   - openssh
#   - archlinuxcn-keyring
#   - bochs
#   - nasm

# add archlinuxcn for include install bochs
echo '[archlinuxcn]' | sudo tee -a /etc/pacman.conf >/dev/null
echo 'SigLevel=Never' | sudo tee -a /etc/pacman.conf >/dev/null
echo 'Server = https://mirrors.tuna.tsinghua.edu.cn/archlinuxcn/$arch' | sudo tee -a /etc/pacman.conf >/dev/null
sudo pacman -Sy
sudo pacman -S archlinuxcn-keyring
# config the network for ssh
sudo pacman -S net-tools openssh
sudo systemctl status sshd.service
sudo systemctl enable sshd.service
sudo systemctl start sshd.service
# isn't need to edit the file /etc/ssh/ssh_config
sudo pacman -S bochs nasm